#include "Wait90SecondsAction.hpp"
#include "Robot.hpp"

pmx::Wait90SecondsAction::Wait90SecondsAction(pmx::Robot* robot) : robot_(robot)
{}

void
pmx::Wait90SecondsAction::execute()
{
    this->logger().info() << "start" << utils::end;
    
    while(this->robot_->chronometerRobot().getElapsedTimeInSec() < 90)
    {
        this->yield();
    }
    
    this->robot_->stop();
    this->logger().info() << "stop of the Robot" << utils::end;
    this->logger().info() << "real execution time: " << this->robot_->chronometerRobot().getElapsedTimeInSec() << utils::end;
    exit(0);
}
